/*
 * Cod_Audio.h
 *
 *  Created on: 02/06/2011
 *      Author: mariano
 */
#ifdef __cplusplus
#define __STDC_CONSTANT_MACROS
#ifdef _STDINT_H
#undef _STDINT_H
#endif
# include <stdint.h>
#endif
extern "C" {
	#include <libavformat/avformat.h>
	#include <libswscale/swscale.h>
}
#include <fstream>
#ifndef DECO_AUDIO_H_
#define DECO_AUDIO_H_

class Deco_Audio {
private:
    AVCodec *codec;
    int out_size, outbuf_size;
    uint8_t outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
    AVCodecContext *decoder_Ctx;
public:
	Deco_Audio();
	virtual ~Deco_Audio();
	void register_codecs();
	int busca_codec();
	int abre_codec();
	int getFrameSize();
	AVCodecContext* getDecoder_Ctx();
	void ini_contexto();
	int decodificar(short **samples, int *outbuf_size, uint8_t **inbuf, int inbuf_size);
};

#endif
